/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Maria Eloyza
 */
public class Util {
    private static SimpleDateFormat dateFormat=new SimpleDateFormat("dd/MM/yyyy");

    public static String DatetoSting(Date data){
        return dateFormat.format(data);
    }

    public static Date StringtoDate(String data){
        try {
            return dateFormat.parse(data);
        } catch (ParseException ex) {
            Logger.getLogger(Util.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }
    
}
